//
//  searchStarCell.m
//  Mango
//
//  Created by lanou3g on 16/5/16.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "searchStarCell.h"

@interface searchStarCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
@property (weak, nonatomic) IBOutlet UILabel *stareLabel;

@end

@implementation searchStarCell

- (void)setModel:(StarInfoModel *)model {
    if (_model != model) {
        _model = model;
        NSString *pic = [model.pic componentsSeparatedByString:@"!"][0];
        [self.iconView sd_setImageWithURL:[NSURL URLWithString:pic] placeholderImage:[UIImage imageNamed:@"placeholder"]];
        self.nameLabel.text = model.name;
        self.descLabel.text = model.Description;
    }
}

- (void)awakeFromNib {
    self.iconView.layer.cornerRadius = 37.5;
    self.iconView.layer.masksToBounds = YES;
}


#pragma mark 切换至日间模式
-(void)updateToDaySkinMode {
    self.nameLabel.textColor = [UIColor blackColor];
    self.descLabel.textColor = [UIColor blackColor];
    self.stareLabel.textColor = [UIColor blackColor];
    self.contentView.backgroundColor = [UIColor whiteColor];
}

#pragma mark 切换至夜间模式
-(void)updateToNightSkinMode {
    self.nameLabel.textColor = [UIColor grayColor];
    self.descLabel.textColor = [UIColor grayColor];
    self.stareLabel.textColor = [UIColor grayColor];
    self.contentView.backgroundColor = [UIColor colorWithRed:42/255.0 green:39/255.0 blue:43/255.0 alpha:1.0];
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
